package com.ys.web.user.friends.mapper;

import com.ys.base.BaseMapper;
import com.ys.web.user.friends.po.BaseUserFriendsPO;
import com.ys.web.user.friends.po.BaseUserWxPO;
import com.ys.web.user.friends.po.UserBlackFriendsPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName UserFriendsMapper
 * @Description UserFriendsMapper
 * @Author qxj
 * @Date 2021/5/9 10:13
 * @Version 1.0
 */
@Mapper
public interface UserFriendsMapper extends BaseMapper<BaseUserFriendsPO> {

    /**
     * @title queryFriendsByPhone
     * @description
     * @author qxj
     * @param: key 通过电话号码获取好友信息
     * @updateTime 2021/5/9 16:31
     * @return: com.ys.web.user.friends.po.BaseUserWxPO
     */
    BaseUserWxPO queryFriendsByPhone(String key);

    /**
     * @param uid
     * @param userId
     * @title getFriendsDetailByUserId
     * @description
     * @author qxj
     * @updateTime 2021/5/9 17:52
     * @return: com.ys.web.user.friends.po.BaseUserFriendsPO
     */
    BaseUserFriendsPO getFriendsDetailByUserId(@Param("uid") String uid, @Param("userId") String userId);

    /**
     * @param uid 用户id
     * @title getFriendsListByUserId
     * @description 根据用户id 获取用户好友集合
     * @author quxinjun
     * @updateTime 2021/5/10 11:55
     * @return: java.util.List<com.ys.web.user.friends.po.BaseUserFriendsPO>
     */
    List<BaseUserFriendsPO> getFriendsListByUserId(String uid);

    /**
     * @param uid 操作用户id
     * @title findFriendsRemarkByUid
     * @description 获取好友备注信息
     * @author quxinjun
     * @updateTime 2021/5/18 19:31
     */
    List<BaseUserFriendsPO> findFriendsRemarkByUid(Long uid);

    /**
     * @param uid      uid 操作用户id
     * @param friendId 拉黑的好友id
     * @param type     操作类型  1添加黑名单  2移出黑名单
     */
    int friendBlack(@Param("userId") String uid, @Param("friendId") long friendId, @Param("type") int type);

    /**
     * 获取所有黑名单
     * @return
     */
    List<UserBlackFriendsPO> friendBlackList();

    /**
     * @param groupId  群id
     * @param memberId 成员id
     * @title findMemberInfoByGroupId
     * @description 从群里获取成员信息
     * @author quxinjun
     * @updateTime 2021/5/28 14:23
     * @return: com.ys.web.user.friends.po.BaseUserFriendsPO
     */
    BaseUserFriendsPO findMemberInfoByGroupId(@Param("groupId") String groupId, @Param("memberId") long memberId,@Param("uid") Long uid);

    int isFriend(@Param("uid1") long uid1, @Param("uid2") String uid2);

    int groupManager(@Param("uid")String uid);

    int userFriendNumber(@Param("uid")String uid);

    int userApplyNumber(@Param("uid")String uid);

    int friendsCount(@Param("uid")long uid, @Param("friendsId")long friendsId);

    /**
     * 复制用户的好友数据
     * @param uid
     * @param friendsId
     * @return
     */
    int copyUserFriend(@Param("uid")long uid, @Param("friendsId")long friendsId);
    /**
     * 复制好友为当前用户的数据
     * @param uid
     * @param friendsId
     * @return
     */
    int copyFriendUser(@Param("uid")long uid, @Param("friendsId")long friendsId);

    List<BaseUserFriendsPO> getFriendsByUserId(@Param("friendsId")long friendsId);

    int accountStatus(@Param("uid")long uid);
}
